<div class="grid_4">
	<div class="da-panel">
		<div class="da-panel-header">
			<span class="da-panel-title"> <img
				src="images/icons/color/accept.png" alt="" /> General code
			</span>
		</div>
		<div class="da-panel-content">
			<form id="da-ex-validate1" class="da-form" action="" method="post">
				<div id="da-ex-val1-error" class="da-message error"
					style="display: none;"></div>
				<div class="da-form-inline">
					<div class="da-form-row">
						<label>General by:<span class="required">*</span></label>
						<div class="da-form-item small">
							<select name="type">
								<option value="1">Database</option>
								<option value="2">File schema (.yml)</option>
							</select>
						</div>
					</div>
					<div class="da-form-row">
						<label>File schema:</label>
						<div class="da-form-item large">
							<input type="text" name="schema" />(file schema.yml stored place
							directory root of project)
						</div>
					</div>
					<div class="da-form-row">
						<label>Adapter:<span class="required">*</span></label>
						<div class="da-form-item large">
							<input type="text" name="adapter" />
						</div>
					</div>
					<div class="da-form-row">
						<label>Host:<span class="required">*</span></label>
						<div class="da-form-item large">
							<input type="text" name="host" />
						</div>
					</div>
					<div class="da-form-row">
						<label>Username:<span class="required">*</span></label>
						<div class="da-form-item large">
							<input type="text" name="username" />
						</div>
					</div>
					<div class="da-form-row">
						<label>Password:</label>
						<div class="da-form-item large">
							<input type="text" name="password" />
						</div>
					</div>
					<div class="da-form-row">
						<label>Database:<span class="required">*</span></label>
						<div class="da-form-item large">
							<input type="text" name="database" />
						</div>
					</div>
				</div>
				<div class="da-button-row">
					<input type="submit" value="Save" class="da-button red" />
				</div>
			</form>
		</div>
	</div>
</div>
<script>
	$(document).ready(function(){
		if ($.fn.validate) {
			$("#da-ex-validate1")
					.validate(
							{
								rules : {
									type : {
										required : true
									},
									adapter : {
										required : true
									},
									host : {
										required : true
									},
									username : {
										required : true
									},
									database : {
										required : true
									}
								},
								invalidHandler : function(e, c) {
									var f = c
											.numberOfInvalids();
									if (f) {
										var d = f == 1 ? "You missed 1 field. It has been highlighted"
												: "You missed "
														+ f
														+ " fields. They have been highlighted";
										$("#da-ex-val1-error")
												.html(d).show()
									} else {
										$("#da-ex-val1-error")
												.hide()
									}
								}
							});
			$("#da-ex-validate2")
					.validate(
							{
								rules : {
									minl1 : {
										required : true,
										minlength : 5
									},
									maxl1 : {
										required : true,
										maxlength : 5
									},
									rangel1 : {
										required : true,
										rangelength : [ 5, 10 ]
									},
									min1 : {
										required : true,
										digits : true,
										min : 5
									},
									max1 : {
										required : true,
										digits : true,
										max : 5
									},
									range1 : {
										required : true,
										digits : true,
										range : [ 5, 10 ]
									}
								},
								invalidHandler : function(e, c) {
									var f = c
											.numberOfInvalids();
									if (f) {
										var d = f == 1 ? "You missed 1 field. It has been highlighted"
												: "You missed "
														+ f
														+ " fields. They have been highlighted";
										$("#da-ex-val2-error")
												.html(d).show()
									} else {
										$("#da-ex-val2-error")
												.hide()
									}
								}
							});
			$("#da-ex-validate3").validate({
				ignore : ".ignore",
				rules : {
					gender : {
						required : true
					},
					sport : {
						required : true
					},
					file1 : {
						required : true,
						accept : [ ".jpeg" ]
					},
					dd1 : {
						required : true
					},
					chosen1 : {
						required : true
					},
					spin1 : {
						required : true,
						min : 5,
						max : 10
					}
				}
			});
			$("#da-ex-validate4").validate({
				rules : {
					email : {
						required : true,
						email : true
					},
					pass2 : {
						required : true,
						minlength : 5
					},
					cpass2 : {
						required : true,
						minlength : 5,
						equalTo : "#pass2"
					},
					address : {
						required : "#souvenirs:checked"
					}
				}
			})
		}
	});
</script>